// 用户个人应聘

var MyApply = Vue.component('MyApply', {
    props: [''],
    data: function () {
        return {
            tableData: [
                {
                    id: 0,
                    name: "A公司0",
                    type: "主动投递",
                    status: "投递中",
                    time: "2018-06-18"
                }, {
                    id: 1,
                    name: "A公司1",
                    type: "主动投递",
                    status: "投递中",
                    time: "2018-06-18"
                }, {
                    id: 2,
                    name: "A公司2",
                    type: "主动投递",
                    status: "投递中",
                    time: "2018-06-18"
                }, {
                    id: 3,
                    name: "A公司3",
                    type: "主动投递",
                    status: "投递中",
                    time: "2018-06-18"
                }
            ],
            page: {
                totalPage: 10,
                totalNum: 1,
                pageNum: 10
            }
        }
    },
    created() {
        console.log("请求数据")
    },
    methods: {
        onResume: function () {
            console.log("预览简历")
        },
        onView: function (_id) {
            console.log("查看：", this.tableData[_id])
        },
        givePageFun: function () {
            console.log("切换页数")
        }
    },
    template: `<div class="my-apply">
            <div class="apply-header">
                <div class="apply-header-name">应聘列表</div>
                <button class="apply-header-resume" @click="onResume">我的简历预览</button>
            </div>
            <div class="apply-table apply-table-header apply-index">
                <table>
                    <tr>
                        <th>公司名称</th>
                        <th>投递类型</th>
                        <th>投递状态</th>
                        <th>投递时间</th>
                        <th>操作</th>
                    </tr>
                    <tr v-for="value in tableData" v-key="value.id">
                        <td>{{value.name}}</td>
                        <td>{{value.type}}</td>
                        <td>{{value.status}}</td>
                        <td>{{value.time}}</td>
                        <td><a href="./StaffInfo.html#/apply/detail" @click="onView(value.id)">查看</a></td>
                    </tr>
                </table>
            </div>
            <div class="apply-table apply-table-footer">
                <common-page :getPage="page" @givePageFun="givePageFun"></common-page>
            </div>
        </div>`
})